// 数组中的查找方法
// indexOf()
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
console.log(arr.indexOf(5)) // 4
console.log(arr.indexOf(10)) // 9
console.log(arr.indexOf(11)) // -1

// lastIndexOf()
console.log(arr.lastIndexOf(5)) // 4
console.log(arr.lastIndexOf(10)) // 9
console.log(arr.lastIndexOf(11)) // -1

// includes()
console.log(arr.includes(5)) // true
console.log(arr.includes(10)) // true
console.log(arr.includes(11)) // false

// find()
console.log(arr.find(item => item > 5)) // 6
console.log(arr.find(item => item > 10)) // undefined

// findIndex()
console.log(arr.findIndex(item => item > 5)) // 5
console.log(arr.findIndex(item => item > 10)) // -1
